package com.note.service;
import java.util.ArrayList;
import java.util.List;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.note.pojo.User;
@Component("userService")
@Scope("singleton")
public class UserService {
	/**
	 * 得到张三
	 * @return
	 */
	public User getZhangsan() {
		User user = new User();
		user.setUid(001);
		user.setName("张三");
		user.setDesc("开发工程师");
		user.setAge(28);
		return user;
	}
	/**
	 * 得到李四
	 * @return
	 */
	public User getLisi() {
		User user = new User();
		user.setUid(002);
		user.setName("李四");
		user.setDesc("测试工程师");
		user.setAge(28);
		return user;
	}
	/**
	 * 得到所有用户
	 * @return
	 */
	public List<User> getUsers() {
		List<User> list = new ArrayList<User>();
		list.add(new User(101,"张飞","php工程师",23));
		list.add(new User(101,"赵云","jsp工程师",22));
		list.add(new User(101,"诸葛亮","ajax工程师",33));
		list.add(new User(101,"刘备","ruby工程师",20));
		return list;
	}
}